import 'package:finance_app/src/entities/my_invitations_entity.dart';

myInvitationsEntityFromJson(MyInvitationsEntity data, Map<String, dynamic> json) {
	if (json['company_id'] != null) {
		data.companyId = json['company_id'] is String
				? int.tryParse(json['company_id'])
				: json['company_id'].toInt();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['company_name'] != null) {
		data.companyName = json['company_name'].toString();
	}
	if (json['expired_at'] != null) {
		data.expiredAt = json['expired_at'].toString();
	}
	if (json['logo'] != null) {
		data.logo = json['logo'];
	}
	return data;
}

Map<String, dynamic> myInvitationsEntityToJson(MyInvitationsEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['company_id'] = entity.companyId;
	data['name'] = entity.name;
	data['company_name'] = entity.companyName;
	data['expired_at'] = entity.expiredAt;
	data['logo'] = entity.logo;
	return data;
}